home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Forms Misc / spaces-to-plus-symbol.izs < prev    next >
Text File  |  2005-09-28  |  2KB  |  116 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Spaces to Plus Symbol 
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>Replaces single or multiple spaces in a text box entry with plus (+) symbols. Handy if your server's form processing or database management program requires this type of encrypted format. <!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>Forms<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13.  
  14. <!-- HOW TO INSTALL SPACES TO PLUS SYMBOL:
  15.  
  16.   1.  Copy code into the HEAD section of document
  17.   2.  Put last coding into the BODY section of document  -->
  18.  
  19. <!-- STEP ONE: Add code into HEAD section of document  -->
  20.  
  21. <HEAD>
  22.  
  23. <SCRIPT LANGUAGE="JavaScript">
  24. <!-- Original:  Mike McGrath (mike_mcgrath@lineone.net) -->
  25. <!-- Web Site:  http://website.lineone.net/~mike_mcgrath -->
  26.  
  27.  
  28.  
  29. <!-- Begin
  30. function convertSpaces(str) {
  31. var out = "", flag = 0;
  32. for (i = 0; i < str.length; i++) {
  33. if (str.charAt(i) != " ") {
  34. out += str.charAt(i);
  35. flag = 0;
  36. }
  37. else {
  38. if(flag == 0) {
  39. out += "+";
  40. flag = 1;
  41.       }
  42.    }
  43. }
  44. return out;
  45. }
  46. //  End -->
  47. </script>
  48. </HEAD>
  49.  
  50. <!-- STEP TWO: Add code into BODY section of document  -->
  51.  
  52. <BODY>
  53.  
  54. <form>
  55. Your Full Name:  <input name=input type=text size=15 onBlur="this.value = convertSpaces(this.value);">
  56. <input type=button value="Ok!">
  57. </form>
  58.  
  59. <!-- END OF SCRIPT -->
  60. <!/SCRIPT>
  61.  
  62. <!PREVIEW>
  63. <!-- START OF SCRIPT -->
  64.  
  65.  
  66.  
  67. <!-- HOW TO INSTALL SPACES TO PLUS SYMBOL:
  68.  
  69.   1.  Copy code into the HEAD section of document
  70.   2.  Put last coding into the BODY section of document  -->
  71.  
  72. <!-- STEP ONE: Add code into HEAD section of document  -->
  73.  
  74. <HEAD>
  75.  
  76. <SCRIPT LANGUAGE="JavaScript">
  77. <!-- Original:  Mike McGrath (mike_mcgrath@lineone.net) -->
  78. <!-- Web Site:  http://website.lineone.net/~mike_mcgrath -->
  79.  
  80.  
  81.  
  82. <!-- Begin
  83. function convertSpaces(str) {
  84. var out = "", flag = 0;
  85. for (i = 0; i < str.length; i++) {
  86. if (str.charAt(i) != " ") {
  87. out += str.charAt(i);
  88. flag = 0;
  89. }
  90. else {
  91. if(flag == 0) {
  92. out += "+";
  93. flag = 1;
  94.       }
  95.    }
  96. }
  97. return out;
  98. }
  99. //  End -->
  100. </script>
  101. </HEAD>
  102.  
  103. <!-- STEP TWO: Add code into BODY section of document  -->
  104.  
  105. <BODY>
  106.  
  107. <form>
  108. Your Full Name:  <input name=input type=text size=15 onBlur="this.value = convertSpaces(this.value);">
  109. <input type=button value="Ok!">
  110. </form>
  111.  
  112. <!-- END OF SCRIPT -->
  113. <!/PREVIEW>
  114.  
  115. <!RELATED>NONE<!/RELATED>
  116.